<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul>
        <li>第1个</li>
        <li>第2个</li>
        <li>第3个</li>
        <li>第4个</li>

    </ul>
    <button>新增</button>
    <script>
        var ul = document.querySelector('ul')
        var button = document.querySelector('button')
        button.onclick = function() {
            var lis = document.createElement('li')
            lis.innerHTML = '新增的哦'
            ul.appendChild(lis)
        }
        ul.addEventListener('click', function(e) {
            e.target.remove()
        })
    </script>
</body>

</html>